#pragma once
#include <list>

namespace Utils
{
  template <typename F, typename T>
  static bool ListAddAll(std::shared_ptr<std::list<F>> oldList, std::shared_ptr<std::list<T>> NewList)
  {
    for (auto it : *oldList)
    {
      NewList->push_back(dynamic_cast<T>(it));
    }
  }
  
  template <typename F, typename T>
  static bool ListAddAll(std::shared_ptr<std::list<std::shared_ptr<F>>> oldList, std::shared_ptr<std::list<std::shared_ptr<T>>> NewList)
  {
    for (auto it : *oldList)
    {
      NewList->push_back(std::dynamic_pointer_cast<T>(it));
    }
  }
};